var e = require("../../../uv-ui-tools/libs/mixin/mpMixin.js"), t = require("../../../uv-ui-tools/libs/mixin/mixin.js"), i = require("./props.js"), o = require("../../../../common/vendor.js");

require("../../../uv-ui-tools/libs/function/index.js"), require("../../../uv-ui-tools/libs/function/test.js"), 
require("../../../uv-ui-tools/libs/function/digit.js"), require("../../../uv-ui-tools/libs/util/route.js"), 
require("../../../uv-ui-tools/libs/function/debounce.js"), require("../../../uv-ui-tools/libs/function/throttle.js");

var s = {
    name: "uv-badge",
    mixins: [ e.mpMixin, t.mixin, i.props ],
    computed: {
        boxStyle: function() {
            return {};
        },
        badgeStyle: function() {
            var e = {};
            if (this.color && (e.color = this.color), this.bgColor && !this.inverted && (e.backgroundColor = this.bgColor), 
            this.absolute && (e.position = "absolute", this.offset.length)) {
                var t = this.offset[0], i = this.offset[1] || t;
                e.top = this.$uv.addUnit(t), e.right = this.$uv.addUnit(i);
            }
            return e;
        },
        showValue: function() {
            switch (this.numberType) {
              case "overflow":
                return Number(this.value) > Number(this.max) ? this.max + "+" : this.value;

              case "ellipsis":
                return Number(this.value) > Number(this.max) ? "..." : this.value;

              case "limit":
                return Number(this.value) > 999 ? Number(this.value) >= 9999 ? Math.floor(this.value / 1e4 * 100) / 100 + "w" : Math.floor(this.value / 1e3 * 100) / 100 + "k" : this.value;

              default:
                return Number(this.value);
            }
        },
        propsType: function() {
            return this.type || "error";
        }
    }
}, u = o._export_sfc(s, [ [ "render", function(e, t, i, s, u, r) {
    return o.e({
        a: e.show && (0 !== Number(e.value) || e.showZero || e.isDot)
    }, e.show && (0 !== Number(e.value) || e.showZero || e.isDot) ? {
        b: o.t(e.isDot ? "" : r.showValue),
        c: o.n(e.isDot ? "uv-badge--dot" : "uv-badge--not-dot"),
        d: o.n(e.inverted && "uv-badge--inverted"),
        e: o.n("horn" === e.shape && "uv-badge--horn"),
        f: o.n("uv-badge--".concat(r.propsType).concat(e.inverted ? "--inverted" : "")),
        g: o.s(e.$uv.addStyle(e.customStyle)),
        h: o.s(r.badgeStyle)
    } : {});
} ], [ "__scopeId", "data-v-8c3e535e" ] ]);

wx.createComponent(u);